package com.cncytech.uiautomator_demo.testcase;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

import com.cncytech.uiautomator_demo.BaseTest;
import com.cncytech.uiautomator_demo.RetryWatcher;
import com.cncytech.uiautomator_demo.TestConstant;
import com.cncytech.uiautomator_demo.utils.Describe;

import org.junit.Rule;
import org.junit.Test;

public class FlashPoliciesTest extends BaseTest {
    @Rule
    public RetryWatcher retryWatcher = new RetryWatcher(TestConstant.retryCount);

    @Test
    @Describe(TestConstant.FLASH_FORBIDDEN)
    public void flashForbiddenTest() {

        String msg = TestConstant.FLASH_FORBIDDEN + TestConstant.FAILURE;
        int status = 0;

        assertThat(msg, hmm.setFlashPolicies(status));
        int flashPolicies = hmm.getFlashPolicies();

        assertThat(msg, flashPolicies, is(status));
    }

    @Test
    @Describe(TestConstant.FLASH_ENABLE)
    public void flashEnableTest() {

        String msg = TestConstant.FLASH_ENABLE + TestConstant.FAILURE;
        int status = 1;

        assertThat(msg, hmm.setFlashPolicies(status));
        int flashPolicies = hmm.getFlashPolicies();

        assertThat(msg, flashPolicies, is(status));
    }
}
